package com.yowasa.xiuxian.engine.hone.mental;


import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.Mental;
import com.yowasa.xiuxian.constant.XiuxianConstants;
import com.yowasa.xiuxian.engine.hone.MentalInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bo.user.UserBattle;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;

import java.util.List;

@Mental(name = "长生六道诀")
public class ChangShengLiuDaoJue implements MentalInterface {


    @Override
    public ElementEnum getElement() {
        return ElementEnum.WOOD;
    }

    @Override
    public void limit(UserBO user) {
        if (user.getElement().get("木") < XiuxianConstants.DEFAULT_ELEMENT_ACTIVITY) {
            throw new HandlerException("修习长生六道诀必须具有木灵根");
        }
    }

    @Override
    public String limitDesc() {
        return "具有木灵根";
    }

    @Override
    public String desc() {
        return "木属性心法,特点是能大幅提高修习者的生命力和寿命,小幅提高防御能力";
    }

    @Override
    public List<String> bsList() {
        return Lists.newArrayList("长生术","互济诀", "术法攻击");
    }


    @Override
    public String breakUp(UserBO user) {
        UserBattle upBattle = getBaseUp(user);
        //长生六道诀额外提升
        user.getUserConfig().setLife(user.getUserConfig().getLife() + 50);
        upBattle.setHp(((upBattle.getHp() + 20) * 2));
        upBattle.setChp(upBattle.getHp());
        upBattle.setDef((int) (upBattle.getDef() * 1.2));
        upBattle.setRes((int) (upBattle.getRes() * 1.2));
        upBattle.setImm((int) (upBattle.getImm() * 1.2));
        buildNewUpBattle(user, upBattle);
        return upBattle.getUpDesc();
    }

    @Override
    public List<String> specialList() {
        return Lists.newArrayList("谷神大法");
    }
}
